<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增书籍')" />
	<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-library-add">
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍作者：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="author" id="author" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍出版社：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="publish" id="publish" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍编号：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="isbn" id="isbn" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍简介：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="introduction" id="introduction" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍语言：</label>
				<div class="col-sm-8">
					<select class="form-control" name="language">
						<option value="中文">中文</option>
						<option value="外语">外语</option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍出版日期：</label>
				<div class="input-group date col-sm-8">
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
						<input type="text" class="form-control" id="laydate-publishDate" name="publishDate" placeholder="yyyy-MM-dd">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍价格：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="price" id="price" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍数量：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="count" id="count" required>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label is-required">书籍书籍</label>
				<div class="col-sm-8">
					<select class="form-control" name="typeId">
						<option value="">--请选择书籍类型--</option>
						<option   th:each="libraryType:${libraryTypes}" th:value="${libraryType.typeId}" th:text="${libraryType.tyname}"></option>
					</select>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-js" />
	<script type="text/javascript">
		$(function(){
			layui.use('laydate', function(){
				var laydate = layui.laydate;

				laydate.render({
					elem: '#laydate-publishDate',
					type: 'date'
				});
			});
		});
	</script>
	<script type="text/javascript">
		var prefix = ctx + "admin/library/book";

		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/add", $('#form-library-add').serialize());
	        }
	    }
	</script>
</body>
</html>
